package com.cl.eb.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cl.eb.mapper.EbUserMapper;
import com.cl.eb.model.EbUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LoginService {
    @Resource
    private EbUserMapper ebUserMapper;
    /*
    根据用户名和密码完成登录
    @param ebUser 登录用户对象
    @return
     */
    public EbUser login(EbUser ebUser){
        EbUser lgnUser=ebUserMapper.selectOne(new QueryWrapper<EbUser>()
                .eq("eu_user_name",ebUser.getEuUserName())
                .eq("eu_password",ebUser.getEuPassword()));
        return lgnUser;
    }
}
